Update Windows CI Zuulv2
This document describes a procedure required to update Windows CI Zuulv2 configuration from contrail-windows-ci repository.
Prerequisites
- Ubuntu 16.04 or Windows Subsystem for Linux with Ubuntu
- It will serve as Ansible control machine
- User's public SSH key installed on Zuulv2 instance
- Please contact Windows CI team
- Access to ansible vault key
- Please contact Windows CI team
Steps
-
Install required
apt
dependencies on Ansible control machineapt-get install git python3 python3-pip python3-virtualenv
-
Clone
contrail-windows-ci
repositorycd ~/ git clone https://github.com/Juniper/contrail-windows-ci.git cd contrail-windows-ci
-
Verify that
master
branch contains PRs with required changes to Zuul configuration-
Assuming
PR#2
andPR#1
are required PRs, run the following command:git log --oneline
-
Output will contain a list of merged PRs, from newest to oldest. Required PRs should be at the top:
abcdabc PR#2 abcd123 PR#1 e8691f5 Some other PR 3af841e Some other PR, part 2 # ... omitted
Example
- Assume that add contrail-infra-doc to gerrit (#212) is a latest PR that was merged and this change has to be applied on Zuul
- Then output of
git log
should look like this:93c783b add contrail-infra-doc to gerrit (#212) 1f86f26 zuul: setup-zuul-server playbook; variables in prod inventory (#210) # ... omitted
-
-
Move to
ansible
directorycd ansible
-
Create a virtualenv and install
pip
dependenciespython3 -m virtualenv -p /usr/bin/python3 venv source venv/bin/activate pip install -r python-requirements.txt
-
Create a file for Ansible vault key and populate it with the key
touch ~/ansible-vault-key vim ~/ansible-vault-key # enter ansible vault key into a file
-
Test connection to Zuul with Ansible
ansible -i inventory.prod --private-key=YOUR_PRIVATE_KEY zuul -m ping
- where
YOUR_PRIVATE_KEY
is a path to your SSH private key
- where
-
Run
setup-zuul-server.yml
playbookansible-playbook -i inventory.prod --private-key=YOUR_PRIVATE_KEY setup-zuul-server.yml
Verify that the run completed successfully. The output should be following and
failed
task count must equal zero.# # task list omitted for brevity # PLAY RECAP ******************************************************************************** ********** 10.84.12.75 : ok=22 changed=2 unreachable=0 failed=0 # # ... - task run time omitted for brevity #
failed
task count should be equal to zero